Endoscope inserting direction detecting method

ABSTRACT

An endoscope inserting direction detecting method includes receiving an endoscopic image, sampling pixels, which represent high densities, from data of the endoscopic image, defining an approximate expression for providing an approximate state of a distribution of sampling-pixels, evaluating a difference between a state of distribution of the sampling-pixels and a result of an approximation based on the approximate expression, and determining an endoscope inserting direction, in which an endoscope should be inserted, on the basis of a result of and evaluation of the fourth step.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional application of U.S. application Ser.No. 10/797,714 filed on Mar. 10, 2004, which issued as U.S. Pat. No.7,258,664 on Aug. 21, 2007, the contents of each of which isincorporated herein by reference.

TECHNICAL FIELD

The present invention relates to an endoscope inserting directiondetecting method and an endoscope inserting direction detecting system.More particularly, the present invention is concerned with an endoscopeinserting direction detecting method and an endoscope insertingdirection detecting system which assist in observing or examining anobject having a luminal structure, such as, the large intestine in thefield of medicine or pipes in the field of industries.

BACKGROUND ART

In recent years, medical-purpose endoscopes have been widely adopted inorder to observe an intracavitary organ by inserting an elongatedinsertion unit, which has flexibility, into a body cavity, or to performvarious cures or treatments with a treatment instrument passed through achannel that lies through the insertion unit. Moreover,industrial-purpose endoscopes have been used to observe internalcorrosive states of pipes in buildings.

For insertion of an endoscope in various examinations, a doctor or anengineer who is an operator judges a direction of advancement whileviewing an endoscopic image.

On the other hand, an inserting procedure for examining the largeintestine is hard to do and requires expertise. This is because theshape of the large intestine is complex, the lumen of the largeintestine is narrow, and the shape of the large intestine or the lumenthereof is different from person to person. Moreover, since insertionmust be performed reliably and carefully, a doctor who has littleexperience incurs a large load.

An endoscope is inserted basically in a direction in which a lumenextends. However, the direction of a lumen is not always seen within afield of view offered by an endoscope system. When the endoscope hasapproached a tortuous region of the large intestine (the sigmoid colon,a curvature of the liver or spleen, or the like) or an intestinal wallor fold thereof, a doctor who is an operator must judge from his/herexperience and knowledge in what direction the endoscope should beinserted.

In order to cope with the above situation, a doctor has to experiencemany examinations so as to be able to determine under various criteriain what direction the endoscope should be inserted.

However, a doctor who is inexperienced has a little knowledge orexperience in determining what information should be used to make ajudgement in what manner. Consequently, it becomes necessary to withdrawan endoscope for the purpose of catching a lumen in a field of viewagain. This leads to an increase in examination time or patientdiscomfort.

Moreover, when an endoscope is used to examine pipes in the field ofindustries, an operator who inserts the endoscope into a pipe has toincur a large load because of the complex bending of pipes.

On the other hand, Japanese Patents Nos. 2710384 and 2680111 havedisclosed inserting direction detecting techniques. However, thesetechniques aim to detect a lumen seen within a field of view for imagingbut do not have the advantage of detecting an inserting direction incase the lumen disappears from the field of view.

The present invention attempts to break through the foregoing situation.An object of the present invention is to provide an endoscope insertingdirection detecting method for detecting an inserting direction in casea lumen disappears from a field of view for imaging.

Another object of the present invention is to provide an endoscopeinserting direction detecting system capable of assisting in performingendoscopic examination smoothly by providing an operator withinformation of an inserting direction on the basis of the result ofinserting direction detection.

Still another object of the present invention is to provide an endoscopeinserting direction detecting method capable of prompting an operator toperform an appropriate manipulation in case an endoscope approaches tooclosely the mucosal surface of the lumen of the large intestine or incase there is difficulty in detecting an inserting direction.

DISCLOSURE OF INVENTION

An endoscope inserting direction detecting method in accordance with thepresent invention consists mainly of: a first step of receiving anendoscopic image; a second step of detecting the direction of a changein brightness in the endoscopic image; and a third step of producinginformation concerning an endoscope inserting direction, in which anendoscope should be inserted, on the basis of the result of thedetection.

Another endoscope inserting direction detecting method in accordancewith the present invention consists mainly of: a first step ofdetermining inserting-direction candidates, that is, candidates for anendoscope inserting direction in which an endoscope should be inserted;a second step of receiving an endoscopic image; a third step ofdetecting the direction of a change in brightness in the endoscopicimage; a fourth step of evaluating the similarities among a plurality ofthe inserting-direction candidates and the direction of the change inbrightness; and a fifth step of determining an endoscope insertingdirection on the basis of the evaluation.

Still another endoscope inserting direction detecting method inaccordance with the present invention consists mainly of: a first stepof receiving an endoscopic image; a second step of sampling pixels,which represent high densities, from data of the endoscopic image; athird step of defining an approximate expression for providing anapproximate state of a distribution of sampling-pixels; and a fourthstep of determining an endoscope inserting direction, in which anendoscope should be inserted, on the basis of the result of theapproximation.

Still another endoscope inserting direction detecting method inaccordance with the present invention consists mainly of: a first stepof receiving an endoscopic image; a second step of sampling pixels,which represent high densities, from data of the endoscopic image; athird step of determining a direction based on a combination ofsampling-pixels; and a fourth step of determining an endoscope insertingdirection, in which an endoscope should be inserted, on the basis of thedetermined direction.

Still another endoscope inserting direction detecting method inaccordance with the present invention consists mainly of: a first stepof receiving an endoscopic image; a second step of sampling pixels,which represent high densities, from data of the endoscopic image; athird step of defining an approximate expression for providing anapproximate state of a distribution of sampling-pixels; a fourth step ofevaluating a difference between the distribution of sampling-pixels andthe result of the approximation; a fifth step of determining anendoscope inserting direction, in which an endoscope should be inserted,on the basis of the distribution of sampling-pixels; and a sixth step ofproducing information concerning the determined inserting direction.Herein, if the result of the approximation proves unsatisfactory at thestep of evaluating a difference from the result of the approximation, atleast either of determination of an inserting direction or production ofinformation is not performed.

Still another endoscope inserting direction detecting method inaccordance with the present invention consists mainly of: a first stepof receiving endoscopic images time-sequentially; a second step ofdetecting the direction of a shift in the plurality oftime-sequentially-received endoscopic images; and a third step ofdetermining an endoscope inserting direction, in which an endoscopeshould be inserted, on the basis of the result of the detectionperformed at the first step.

Still another endoscope inserting direction detecting method inaccordance with the present invention consists mainly of: a first stepof receiving an endoscopic image; a second step of detecting anendoscope inserting direction, in which an endoscope should be inserted,on the basis of the endoscopic image; and a third step of producinginformation concerning the detected inserting direction. Herein, aplurality of detecting algorithms according to which an insertingdirection is detected is included, and any of the detecting algorithmsis selected based on the endoscopic image.

An endoscope inserting direction detecting system in accordance with thepresent invention consists mainly of: an endoscopic image inputtingmeans for receiving an endoscopic image; an inserting directiondetecting means including a plurality of detecting algorithms accordingto which an endoscope inserting direction in which an endoscope shouldbe inserted is detected depending on the endoscopic image; an insertionaid information producing means for producing insertion aid informationon the basis of the detected inserting direction. Herein, the insertingdirection detecting means includes a detecting algorithm changing meansfor changing the detecting algorithms, any of which the insertingdirection detecting means adopts, according to the endoscopic image.

Another endoscope inserting direction detecting method in accordancewith the present invention consists mainly of: a first step of receivingan endoscopic image; a second step of judging from the endoscopic imagewhether an endoscope has approached too closely an object ofobservation; and a third step of producing information concerningmanipulations of the endoscope on the basis of the result of thedetection.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an overall configuration of an endoscope system in which afirst embodiment of the present invention is included;

FIG. 2 is an explanatory diagram for explaining insertion of anendoscope shown in FIG. 1;

FIG. 3 shows the configuration of an inserting direction detectingsystem shown in FIG. 1;

FIG. 4 is an explanatory diagram concerning display of insertingdirections by a display device included in the inserting directiondetecting system shown in FIG. 3;

FIG. 5 is a first explanatory diagram showing an example of anendoscopic image to be used to judge an inserting direction by theinserting direction detecting system shown in FIG. 3;

FIG. 6 is a second explanatory diagram showing an example of anendoscopic image to be used to judge an inserting direction by theinserting direction detecting system shown in FIG. 3;

FIG. 7 is an explanatory diagram showing an inserted state of theendoscope shown in FIG. 1;

FIG. 8 is a flowchart describing inserting direction detection to beperformed by the inserting direction detecting system shown in FIG. 3;

FIG. 9 is an explanatory diagram for explaining sampling-pixels to bedetermined in order to detect the direction of a lumen during theprocessing described in FIG. 8;

FIG. 10 is an explanatory diagram for explaining a spatialdifferentiation geometric procedure to be performed in order tocalculate a gradient vector during the processing described in FIG. 8;

FIG. 11 is a first explanatory diagram for explaining direction-of-lumendetection that is performed based on a gradient vector during theprocessing described in FIG. 8;

FIG. 12 is a second explanatory diagram for explainingdirection-of-lumen detection that is performed based on a gradientvector during the processing described in FIG. 8;

FIG. 13 is an explanatory diagram concerning other sampling-pixels to bedetermined during the processing described in FIG. 8;

FIG. 14 is an explanatory diagram concerning domain division to beperformed during the processing described in FIG. 8;

FIG. 15 is an explanatory diagram for explaining division that isperformed in order to associate the outline of an image with thedirection of a lumen during the processing described in FIG. 8;

FIG. 16 is an explanatory diagram concerning projection of a vector tobe performed during the processing described in FIG. 8;

FIG. 17 is an explanatory diagram concerning an arc-shaped halationemployed in a second embodiment of the present invention;

FIG. 18 is a flowchart describing inserting direction detection that isperformed in consideration of the halation described in FIG. 17;

FIG. 19 is an explanatory diagram concerning fining that is performedduring the processing described in FIG. 18;

FIG. 20 is an explanatory diagram concerning sampling that is performedduring the processing described in FIG. 18;

FIG. 21 is an explanatory diagram concerning approximation of the shapeof a halation to an arc that is performed during the processingdescribed in FIG. 18;

FIG. 22 is an explanatory diagram concerning a range of searched pixelsthat is defined to extend around an arc center for the purpose ofapproximation to be performed during the processing described in FIG.18;

FIG. 23 is an explanatory diagram concerning a method of determining thedirection of a lumen during the processing described in FIG. 18;

FIG. 24A is an explanatory diagram before expansion that is performedduring the processing in FIG. 18;

FIG. 24B is an explanatory diagram after expansion has been performedduring the processing in FIG. 18;

FIG. 25A is an explanatory diagram concerning the contents of theprocessing in FIG. 18 performed when a plurality of halations existbefore fining is performed;

FIG. 25B is an explanatory diagram concerning the contents of theprocessing in FIG. 18 performed when a plurality of halations existafter fining has been performed;

FIG. 26 is a flowchart describing inserting direction detection inaccordance with a third embodiment of the present invention;

FIG. 27 is an explanatory diagram concerning a method of determining thedirection of a lumen during the processing described in FIG. 26;

FIG. 28 is an explanatory diagram concerning judgment of an arc shapethat is performed during the processing described in FIG. 26;

FIG. 29 is a flowchart describing inserting direction detection inaccordance with a fourth embodiment of the present invention;

FIG. 30A is an explanatory diagram of a raw image concerning a method ofdetermining the direction of a lumen during the processing in FIG. 29;

FIG. 30B is a first explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing in FIG. 29;

FIG. 31 is a second explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing described inFIG. 29;

FIG. 32 is a third explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing described inFIG. 29;

FIG. 33 is a fourth explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing described inFIG. 29;

FIG. 34 is a flowchart describing inserting direction detection inaccordance with a fifth embodiment of the present invention;

FIG. 35 is an explanatory diagram concerning a case wheredirection-of-lumen detection based on a shift vector is judged to beinappropriate during the processing described in FIG. 34; and

FIG. 36 is an explanatory diagram concerning display of a result wheninserting direction detection described in FIG. 34 is inappropriate orunfeasible.

BEST MODE FOR CARRYING OUT THE INVENTION

Referring to the drawings, embodiments of the present invention will bedescribed below.

Hereinafter, a description will be made of detection of an insertingdirection that is performed in order to insert an endoscope into thelarge intestine. The same can apply to insertion of an endoscope intopipes or a tubular object that is performed in the field of industries.In general, pipes are more rigid than the large intestine that is anintracavitary organ. Moreover, an object does not make a motion stemmingfrom pulsation or the like. Therefore, conditions for detection of aninserting direction are loose. Consequently, the present invention willprove quite advantageous in the field of industries.

Moreover, the embodiments of the present invention aim mainly to presentendoscope insertion aid information, which is acquired during insertingdirection detection, to an operator. The present invention can alsoapply to automatic insertion that is combined with automaticmanipulations of an endoscope. In this case, automatic endoscopemanipulations are controlled so that the endoscope will advance in adetected inserting direction.

First Embodiment

FIG. 1 to FIG. 16 are concerned with a first embodiment of the presentinvention. FIG. 1 shows the overall configuration of an endoscopesystem. FIG. 2 is an explanatory diagram concerning insertion of anendoscope shown in FIG. 1. FIG. 3 shows the configuration of aninserting direction detecting system shown in FIG. 1. FIG. 4 is anexplanatory diagram concerning display of an inserting direction on adisplay device included in the inserting direction detecting systemshown in FIG. 3. FIG. 5 is a first explanatory diagram showing anexample of an endoscopic image based on which an inserting direction isjudged by the inserting direction detecting system shown in FIG. 3. FIG.6 is a second explanatory diagram showing an example of an endoscopicimage based on which an inserting direction is judged by the insertingdirection detecting system shown in FIG. 3. FIG. 7 is an explanatorydiagram concerning an inserted state of the endoscope shown in FIG. 1.FIG. 8 is a flowchart describing inserting direction detection to beperformed by the inserting direction detecting system shown in FIG. 3.FIG. 9 is an explanatory diagram concerning sampling-pixels to bedetermined for direction-of-lumen detection during the processingdescribed in FIG. 8. FIG. 10 is an explanatory diagram concerning aspatial differentiation geometric procedure for calculating a gradientvector during the processing described in FIG. 8. FIG. 11 is a firstexplanatory diagram concerning direction-of-lumen detection to beperformed based on a gradient vector during the processing described inFIG. 8. FIG. 12 is a second explanatory diagram concerningdirection-of-lumen detection to be performed based on a gradient vectorduring the processing described in FIG. 8. FIG. 13 is an explanatorydiagram concerning other sampling-pixels to be determined during theprocessing described in FIG. 8. FIG. 14 is an explanatory diagramconcerning domain division to be performed during the processingdescribed in FIG. 8. FIG. 15 is an explanatory diagram concerningdivision to be performed in order to associate the outline of an imagewith the direction of a lumen during the processing described in FIG. 8.FIG. 16 is an explanatory diagram concerning projection of a vector tobe performed during the processing described in FIG. 8.

Described as the first embodiment of the present invention is aninserting direction detecting method for determining the direction of alumen according to the direction of a gradient in brightness in case thelumen disappears from a field of view for imaging. Also described is aninserting direction detecting system that presents inserting directioninformation to an operator on the basis of the result of processingperformed according to the method so as to assist in performingendoscopic examination more smoothly.

To begin with, referring to FIG. 1, an endoscope system in which thepresent embodiment is included will be described below. Referring toFIG. 1, the endoscope system in which the present embodiment is includedconsists mainly of an endoscope 1, a controller 6, an observationmonitor 9, an inserting direction detecting system 12 that detects anddisplays an inserting direction, and an A/D converter 11.

The endoscope 1 has an operating unit 2 and an insertion unit 3 that isflexible. A solid-state imaging device (CCD) and a light guide end fromwhich illumination light is emitted are incorporated in the distal partof the insertion unit 3. Moreover, the endoscope 1 is connected to avideo signal processing circuit 8 via a connector 5.

The endoscope 1 has an optical fiber over which illumination light ispropagated and a universal cord 4 over which a video signal and variouskinds of control information are transmitted or received. The insertionunit 3 is inserted into the large intestine 13, whereby imageinformation of an intracavitary region is acquired.

The controller 6 includes a light source 7 that generates illuminationlight which is propagated to the endoscope 1, and a video signalprocessing circuit 8 that performs signal processing on a video signalsent from the endoscope 1.

By the controller 6, image information of a visualized intracavitaryregion is transferred as analog red, green, and blue signals to theobservation monitor 9, digitized by the A/D converter 11, andtransferred to the inserting direction detecting system 12.

Next, referring to FIG. 2, a description will be made of insertion ofthe endoscope by taking examination of the large intestine for instance.When the endoscope 1 is used to examine the large intestine, as shown inFIG. 2, the insertion unit 3 of the endoscope 1 that is elongated andflexible is inserted into the large intestine 13. Thus, an intracavitaryregion is observed. For insertion, a doctor who is an operator holds anangle knob which is not shown and is included in the operating unit 2(an operating member for use in angling the distal part of the endoscopeupwards, downwards, rightwards, or leftwards by way of wires or the likelying through the insertion unit 3). The doctor then exploits atechnique for angling the distal part of the endoscope or techniques ofthrusting, withdrawing, and twisting the insertion unit 3. Thus, thedoctor observes a region extending from the anus to the ileocecum thatis the deepest region (linking the small intestine and the largeintestine).

Next, referring to FIG. 3, the configuration of the inserting directiondetecting system 12 in accordance with the present embodiment will bedescribed below.

As shown in FIG. 3, the inserting direction detecting system 12includes: a computer 20 that follows a series of steps so as to performinserting direction detection on red, green, and blue image signalsreceived from the A/D converter 11; and a display device 21 on which theresult of the inserting direction detection is displayed.

Furthermore, the computer 20 includes: a storage device 25 in which amain program 26 for detecting an inserting direction is stored; acentral processing unit (CPU) 23 for executing inserting directiondetection to be performed according to the main program 26; a mainmemory 24; and an I/O control circuit 22 for controlling the inputs andoutputs of the A/D converter 11, storage device 25, display device 21,and CPU 23.

The main program 26 is a program describing a series of steps requiredfor inserting direction detection of the present embodiment. Within themain program 26, a request for acquisition of an image signal from theA/D converter 11 is issued to the I/O control circuit 22, and a requestfor display of the result of inserting direction detection is issued tothe display device 21.

According to the present embodiment, an endoscopic image is digitized bythe A/D converter 11 so that each of red, green, and blue signals willbe quantized into a series of levels which range from level 0 to level255 and each of which is represented by eight bits. The resultant imagedata shall have a size of ISX in a horizontal direction and a size ofISY in a vertical direction. Hereinafter, a description will proceed onthe assumption that a left upper limit that is a location of one ofpixels constituting endoscopic image data shall be represented bycoordinates (0,0) and a right lower limit shall be represented bycoordinates (ISX-1, ISY-1).

Next, a description will be made of an example of display of the resultof inserting direction detection on the display device 21 included inthe inserting direction detecting system 12.

The endoscope is inserted into a luminal organ such as the largeintestine in a direction in which the lumen of the large intestineextends. In this case, the endoscope must be inserted accurately andsafely with the lumen of the large intestine caught in a field of viewfor imaging. However, the lumen may disappear from the field of view forvarious reasons that will be described later. Moreover, a case where adoctor who has a little experience cannot decide in what direction thelumen extends takes place frequency. In this case, the endoscope 1 mustbe withdrawn (or pulled back) so that the lumen will enter the field ofview. This results in an increase in examination time.

In the inserting direction detecting system 12 of the presentembodiment, when a lumen is not visualized clearly as part of anendoscopic image, an inserting direction is detected by adopting animage processing technique. The information of the inserting directionis then presented to a doctor who performs examination. Thus, thepresent embodiment assists in achieving endoscopic examination smoothly.

Concrete inserting direction information is, as shown in FIG. 4, any ofarrows indicating eight directions which is superposed on an endoscopicimage. The eight directions are different from one another by 45°. Adoctor who performs endoscopic examination angles the endoscope, thrustsor pulls it, or twists it so that the endoscope will advance in thedirection of the superposed arrow. Thus, the doctor can catch the lumenin the field of view.

According to the present embodiment, for convenience' sake, an insertingdirection is determined as one of the eight directions. Alternately, theinserting direction may be selected from sixteen directions, which aredifferent from one another by 22.5°, or more. The number of options canbe determined appropriately according to the skill of a doctor whoperforms examination or the necessity.

Next, a description will be made of an inserting direction detectingmethod in accordance with the present embodiment.

A maneuver of inserting an endoscope for the purpose of examination ofthe large intestine ranks high in difficulty and requires a skill. Thisis because the shape of the large intestine is complex, the lumenthereof is narrow, and the shape and lumen of the large intestine differfrom person to person. Since insertion must be performed accurately andcarefully, the insertion imposes a heavy load on a doctor who has alittle experience. Basically, an endoscope is inserted in a direction inwhich a lumen extends. However, the direction of the lumen is not alwaysseen within a field of view offered by an endoscope system. When anendoscope approaches too closely a curved region of the large intestine(the sigmoid colon, or a curvature of the liver or spleen) or anintestinal wall or fold, a doctor who is an operator must judge aninserting direction from his/her experience or knowledge. In order tocope with such a situation, a doctor has to experience many examinationsso as to be able to determine an inserting direction under variouscriteria.

Specifically, for example, in an endoscopic image shown in FIG. 5, alumen is clearly seen within a field of view. It is therefore judgedthat an endoscope should be kept inserted rectilinearly. On the otherhand, in an endoscopic image shown in FIG. 6, a lumen is not seen withinthe field of view. An inserting direction, or in other words, adirection in which the lumen is found must therefore be judged from someinformation.

According to the present embodiment, as a technique for determining aninserting direction in case a lumen is not seen within a field of view,a direction detecting method that employs the direction of a gradient inbrightness will be described below.

One of the criteria under which an inserting direction is judged in casea lumen is not seen within a field of view is the direction of a changein brightness in an image. For example, when the large intestine 13 andthe distal part of the insertion unit 3 of the endoscope have apositional relationship shown in FIG. 7, a change in brightness occurswidely from a position near the distal end of the endoscope to aposition far from it. There is a high possibility that an insertingdirection is a direction receding from the distal end of the endoscope.Therefore, an inserting direction can be determined by detecting thedirection of a change from a light to a shade in an image.

FIG. 8 describes a series of steps to be followed in order to performinserting direction detection in accordance with the present embodiment.Herein, the processing is performed on data of each frame represented byan endoscopic image signal received via the A/D converter 11.

At step S1 in FIG. 8, a red image is acquired from among red, green, andblue images constituting a received endoscopic image. The processing inaccordance with the present embodiment will be described by taking thered image for instance. The green or blue image or a luminance image(=0.3R+0.6G+0.1B) may be used to perform the same processing as the onedescribed below.

At step S2, M sampling-pixels (where M denotes an integer equal to orlarger than 1) are determined from data of the red image. Thesampling-pixels are determined so that the whole image data can besampled. FIG. 9 shows an example of sampling-pixels.

At step S3, a gradient vector is calculated in order to obtain thedirection of a gradient in brightness in each sampling-pixel. In thepresent embodiment, a spatial differentiation geometric procedure isadopted as a technique for calculating a gradient vector. FIG. 10 is anexplanatory diagram concerning a gradient vector calculating methodbased on the spatial differentiation geometric procedure.

First, as shown in FIG. 10, neighbor pixels arranged in N rows and Ncolumns (N denotes 5 in FIG. 10) with a sampling-pixel P as a center aresampled. Pixels located at limits in horizontal and vertical directionsand diagonal directions shall be regarded as pixels A, B, C, D, E, F, G,and H. Based on the pixel values, spatial differentiations SX and SY ofpixel values arranged in the horizontal and vertical directionsrespectively are calculated as follows:SX=(C+E+H)−(A+D+F)  (1)SY=(F+G+H)−(A+B+C)  (2)

In the expressions (1) and (2), A, B, C, D, E, F, G, and H denotedensities represented by the pixels.

Using the calculated SX and SY values, a gradient vector V (_ means avector) is expressed as follows:V=(SX,SY)  (3)

Moreover, the magnitude |V| of the gradient vector V, and the directionof a gradient Vθ are calculated as follows:V =√{square root over (S _(X) ² +S _(Y) ²)}  (4)Vθ =tan⁻¹(SY/SX)  (5)

The foregoing gradient vector V is calculated for each of the Msampling-pixels. Herein, Vi (where i denotes 1, 2, etc., and/or M)denotes the gradient vector or vectors for each or all of the Msampling-pixels.

At step S4, direction-of-lumen detection is performed. The contents ofdirection-of-lumen detection employed in the present embodiment will bedescribed in conjunction with FIG. 11 and FIG. 12.

Points on the outline of an image located in the eight directionsdescribed using FIG. 4 shall be points Qk (where k denotes, 1, 2, etc.,or 8). Assuming that the image has a size of ISX by a size of ISY,coordinates representing the points are determined as shown in FIG. 11.The coordinates representing the points Qk shall be (qx, qy), andcoordinates representing sampling-pixels Pi shall be (px, py). In thiscase, a vector Qk linking each point Qk and each pixel Pi are expressedas follows:Qk =(qx−px,qy−py)  (6)

A lumen is found in a direction of a change from a light to a shade inan image. Herein, V′θi shall denote an inverse vector of a gradientvector Vi representing a gradient in brightness in a sampling-pixel Pi(since the direction of a gradient expressed by the expression (5) is adirection of a change from a shade to a light, the gradient vector isinverted). The direction of a vector Qk from the pixel Pi to a point Qkthat is located most closely to the inverse vector V′θi is regarded asthe direction of the lumen.

Specifically, an angle φik at which a vector Qk and an inverse vectorV′θi meets as shown in FIG. 12 is calculated by solving expression (7)below.φik=cos⁻¹{(Qk·V′θi)/(|Qk|×|V′θ i|)}  (7)where · denotes an inner product of two vectors, and | | denotes themagnitude of a vector.

The φik value is larger than −180 and smaller than or equal to +180.Assuming that a lumen is found in a direction to a point Qk, that is,the direction of a gradient is close to the direction of a vector Qk,the φik value approaches 0 (units: degree).

Consequently, when the angle φik is calculated relative to allsampling-pixels that lie in the direction of a lumen, and a k value thatminimizes an error evaluation value presented below is calculated. Thus,the most reliable direction in which a gradient in brightness changesfrom a light to a shade can be determined.

$\begin{matrix}{{E(k)} = {\sum\limits_{i = 1}^{M}{\phi_{ik}}}} & (8)\end{matrix}$

At step S5, a direction determined as the direction of a lumen isregarded as an inserting direction. Arrow information shown in FIG. 4 isthen superposed on an image, and the resultant image is displayed on thedisplay device 21. Control is then returned to step S1, and the samesteps are repeated for image data representing the next frame.

According to the present embodiment, N determining the size of aneighborhood shown in FIG. 10 is set to 5. Alternatively, N may be setto a larger value (for example, 17). A gradient in brightness in alarger area may be detected. Prior to calculation of a gradient vectorusing sampling-pixels, low-pass filtering (so-called blue masking) maybe performed as pre-processing. In this case, an adverse effect of noiseor a mucosal structure such as vessels can be eliminated and precisionin detecting an inserting direction can be improved.

Moreover, a sum total of values of the angle φik expressed as expression(8) is adopted for error evaluation. Needless to say, the expression (8)may be replaced with another function of the angle φik.

Moreover, a threshold may be used to evaluate the sampling-pixel P shownin FIG. 10 and the neighbor pixels A to H required to calculate agradient vector in order to eliminate an adverse effect of a halation orprevent incorrect detection. More particularly, the value of each ofpixels that are contained in a local domain having a size of N rows andN columns and that include the pixels A to H and P is compared with athreshold THL (for example, THL equals 250). If any pixel value exceedsthe THL value, the location of the sampling-pixel P is changed or thesampling-pixel P is unused to detect an inserting direction.

If the magnitude |Vi| equals 0, it means that a gradient in brightnessis a nil. The gradient vector Vi is therefore unused to detect aninserting direction. Specifically, the angle φik at which an inversevector of a gradient vector Vi meets a vector Qk is not calculatedaccording to expression (7) but is set to 0 irrespective of what value kassumes, that is, φi1=φi2= . . . =φiK=0. (The value of a sampling-pixelwhose gradient vector has a magnitude |Vi| of 0 does not contribute tothe result of expression (8)).

During direction-of-lumen detection to be performed at step S4, thedirection (angle) Vθ of a gradient vector V representing a change inbrightness is employed. Since there is a high probability that a lumenmay be found in a direction in an endoscopic image in which brightnesschanges greatly, the magnitude |V| may be utilized. Specifically,gradient vectors Vi (1≦i≦M) are calculated for M sampling-pixels, and amaximum magnitude max|Vi| out of the magnitudes of the gradient vectorsis detected. All the vectors Vi are then normalized as expressed asfollows:αi=|Vi|/max|Vi|  (9)

In expression (9), the αi value of the i-th gradient vector Vi that hasthe maximum magnitude max|Vi| equals 1. The αi value of any othergradient vector (whose magnitude |Vi| is not equal to 0) is larger than0 and smaller than and equal to 1. When the αi value is utilized as aweight coefficient, the expression (8) is rewritten as follows:

$\begin{matrix}{{E(k)} = {\sum\limits_{i = 1}^{M}\left( \frac{\phi_{ik}}{\alpha_{i}} \right)}} & (10)\end{matrix}$Sampling-pixels are, as shown in FIG. 9, equally selected from all overdata of an entire image. Alternatively, as shown in FIG. 13, a center ofan image may be excluded, and sampling-pixels may be selected from dataof a marginal part of the image which contains a larger amount ofbrightness change information representing a change in brightnessoriented in the direction of a lumen.

As shown in FIG. 14, image data may be divided into domains, and aninserting direction may be detected through processing that is performedon a direction associated with each domain as mentioned below. Referringto FIG. 14, sampling-pixels are selected from the division domains inthe marginal part of the image data. The division domains are associatedwith the directions shown in FIG. 11 and FIG. 15 on a one-to-one basis(the center part of the image data is excluded).

Referring to FIG. 15, points U1 to U8 are points on the outline of animage that are obtained by trisecting the horizontal and verticallengths of the outline. A division of the outline defined with a pair ofpoints U1 and U3, U1 and U2, U2 and U4, U3 and U5, U4 and U6, U5 and U7,U7 and U8, or U6 and U8 is associated with the same direction as pointQ1, Q2 . . . Q7, or Q8 shown in FIG. 11, respectively.

A domain in which a change in brightness occurring in a directionassociated with the domain is the largest is detected, and theassociated direction is determined as an inserting direction.Specifically, Mk sampling-pixels contained in each domain k (1≦k≦K) areprojected to points Qk on a division of the outline associated with thedomain. A sum total of the magnitudes of vectors directed from thesampling-points to the points Qk associated with each domain k of thevectors (an example is shown in FIG. 16) is calculated as follows:

$\begin{matrix}{{\xi(k)} = {\sum\limits_{j = 1}^{M_{k}}\left( {{\underset{\_}{V_{j}}} \times \cos\;\phi_{jk}} \right)}} & (11)\end{matrix}$

The sum total ζ(k) is calculated relative to all domains, and adirection associated with a domain that gives the largest sum total ζ(k)is regarded as an inserting direction.

As described above, the inserting direction detecting method of thefirst embodiment of the present invention, and the inserting directiondetecting system that presents inserting direction information to anoperator on the basis of the result of processing performed according tothe method can provide an operator, who is unskilled in endoscopicexamination, with insertion aid information. Consequently, theendoscopic examination can be performed smoothly.

Second Embodiment

FIG. 17 to FIG. 25 are concerned with a second embodiment of the presentinvention. FIG. 17 is an explanatory diagram concerning a halation seenas an arc. FIG. 18 is a flowchart describing inserting directiondetection to be performed in consideration of the halation shown in FIG.17. FIG. 19 is an explanatory diagram concerning fining to be performedduring the processing described in FIG. 18. FIG. 20 is an explanatorydiagram concerning sampling to be performed during the processingdescribed in FIG. 18. FIG. 21 is an explanatory diagram concerningapproximation of the shape of the halation to an arc which is performedduring the processing described in FIG. 18. FIG. 22 is an explanatorydiagram concerning a searched range around an arc center for the purposeof approximation to be performed during the processing described in FIG.18. FIG. 23 is an explanatory diagram concerning a method of determiningthe direction of a lumen during the processing described in FIG. 18.FIG. 24 is an explanatory diagram concerning expansion to be performedduring the processing described in FIG. 18. FIG. 25 is an explanatorydiagram concerning the contents of the processing described in FIG. 18which are adopted when a plurality of halations is seen.

The second embodiment is nearly identical to the first embodiment.Differences alone will be described below. The same reference numeralswill be assigned to components identical to those of the firstembodiment, and the description of the components will be omitted.

Described as the second embodiment of the present invention is aninserting direction detecting method that when a lumen disappears from afield of view for imaging, determines the direction of the lumen on thebasis of the property of the shape of a halation stemming fromreflection from a mucosal surface or the like. Also described is aninserting direction detecting system that presents inserting directioninformation to an operator according to the result of the processingperformed according to the method and thus assists in performingendoscopic examination smoothly.

In endoscopic examination, a phenomenon that is generally known as ahalation occurs. Specifically, because of intense mirror reflectioncaused by a mucosal surface or the like opposed to the distal end of anendoscope, an output signal of a CCD is saturated or a signal componentrepresenting the mucosal surface assumes an apparently higher level thanthe other components representing the surroundings. An endoscopic viewimage of the large intestine or any other organ having a lumen maysuffer from an arc halation.

For example, in the inserted state shown in FIG. 7, an arc halationshown in FIG. 17 occurs. Since there is a high possibility that thedirection of the center of the arc agrees with the direction of a lumen,a skilled doctor utilizes the arc halation as insertion aid informationand keeps inserting an endoscope rightward within a field of view forimaging.

In the present embodiment, an image processing technique is adopted inorder to judge whether a halation occurring in an image is seen as anarc. If so, the direction of the center of the arc is inferred andutilized as inserting direction information.

The configurations of an endoscope system and an inserting directiondetecting system in accordance with the present embodiment are identicalto the endoscope system and the inserting direction detecting system ofthe first embodiment. The contents of the main program 26 are different.The contents of image processing to be executed by running the mainprogram 26 will be detailed below.

FIG. 18 is a flowchart describing inserting direction detectiondescribed in the main program 26 employed in the present embodiment. Atstep S11, similarly to step 1 described in FIG. 8 in relation to thefirst embodiment, a red image out of red, green, and blue imagesconstituting an endoscopic image is acquired. Alternatively, the greenor blue image or a luminance image may be used to perform processingidentical to the one described below.

At step S12, pixels constituting the received data of the red image arebinary-coded using a threshold, and halation pixels are sampled.Specifically, a binary-coded image H is produced based on the value r(x,y) of each pixel whose location is represented by coordinates (x, y)(0≦x<ISX, 0≦y<ISY). The value of each pixel h(x, y) contained in theimage H is set to 1 or reset to 0 as follows:h(x,y)=1 if r(x,y)≧THLh(x,y)=0 if r(x,y)<THL  (12)where the threshold THL may be set to 255 or set to 240 in order toprovide a little tolerance. The setting of the threshold THL is modifiedappropriately. This is because even if a pixel value does not equal to amaximum value of 255, a halation may be discerned.

At step S13, the binary-coded image H is used to judge if the halationis seen as an arc. This is because since a halation is not always seenas an arc, it must be judged whether the halation can be used to detectan inserting direction.

According to the present embodiment, a circle to which a sampledhalation is approximated is determined by varying a parameter that isthe position of a center or a radius so as to search for an optimalposition and an optimal radius. An error of the shape of the halationthat is an object of processing from an arc defined with an equation isevaluated.

First, known fining is performed as pre-processing to be performed onthe halation image H (if the halation has branches or the like,regeneration is also performed). FIG. 19 shows an example of the resultof fining performed on the halation image (in FIG. 19, black isassociated with a pixel value of 1).

Incidentally, regeneration is described in, for example, “Guide toComputer Image Processing” (P. 75-83, supervised by Hideyuki Tamura,compiled by Industrial Technology Center of Japan, published by SokenPublishing, sold by Seiun Co. Ltd.).

Fined pixels whose locations are represented by coordinates h(x, y) andwhich suffer from the halation are sampled. For sampling, pixelssuffering from both ends of the halation and a middle point between theends are determined, and NS pixels whose locations are represented bycoordinates h(x, y) are sampled nearly equidistantly to one another. TheNs sampling-pixels whose locations are represented by coordinates h(x,Y) shall be regarded as pixels hj(xj, yj) where 1≦j≦Ns. FIG. 20 shows anexample of sampling. The sampling is intended to shorten the timerequired for calculation, and can be omitted as long as the performanceof the CPU 23 is satisfactory.

Next, the pixels hj(xj, yj) that are fined and sampled are checked tojudge whether a halation is seen as an arc through the processingcomposed of steps described below.

First, a searched range within which the center of a circle to which theshape of a halation is approximated and the radius thereof are searchedfor is defined. As shown in FIG. 21, a triangle PQR is defined withpixels h1(x1, y1), hNs/2(x Ns/2, y Ns/2), and hNs(x Ns, y Ns), and ahalf line τ orthogonal to a side PR is defined to have a point Q as alimit thereof. As shown in FIG. 22, points S1 and S2 satisfying PS1=QS1and PS2=QS2 are defined on the half line τ. A circle whose centercoincides with a middle point S (represented by coordinates (xs, ys))between the points S1 and S2 and whose radius r equals s/2 (where s is alength of S1S2 ) is defined as a searched range of the center. Kcenter-point candidates Ck (1≦K, 1≦k≦K) are determined. The radius rk ofa center having a center-point candidate Ck as its center is determinedbased on the candidate Ck and set to CkQ, that is, rk=CkQ. Assuming thatthe position of a center-point candidate Ck is represented bycoordinates (cxk, cyk), an error evaluation value for each of Ns pixelshj(xj, yj) relative to the circle Ck is calculated as follows:

$\begin{matrix}{{ɛ(k)} = {\frac{1}{N_{s}} \times \left\lbrack {\sum\limits_{j = 1}^{N_{s}}\left\{ {\left( {x_{j} - c_{xk}} \right)^{2} + \left( {y_{j} - c_{yk}} \right)^{2} - r_{k}^{2}} \right\}} \right\rbrack}} & (13)\end{matrix}$

K error evaluation values ε(k) are calculated according to theexpression (13). The minimum error evaluation value min(ε(k)) iscompared with a threshold THE adopted as a criterion for judging whetherthe shape of a halation is recognized as an arc. If the minimum errorevaluation value min(ε(k)) is smaller than the threshold THE, the shapeof the halation is judged to be arc.min(Γ(k))<THE  (14)

At step S14, if the condition (14) is satisfied, control is passed tostep S15. If not, control is returned to step S11. It is then judgedwhether control is passed in order to execute processing for image datarepresenting the next frame.

At step S15, the direction of a lumen is determined. The direction of alumen substantially agrees with the direction of the center of an arc towhich the shape of a halation is approximated. Therefore, a half line τkis defined to link the center Ck of a circle Ck relative to which theerror evaluation value is minimum and the point Q shown in FIG. 21 isdefined as shown in FIG. 23 (an equation of a straight line is easilydefined using coordinates representing two points and the description ofthe equation is therefore omitted). A point of intersection T at whichthe half line τk intersects the outline of an image is defined. As forfour sides constituting the outline of an image, the horizontal andvertical lengths are, as shown in FIG. 15, trisected (ISX/3, ISY/3). Theresultant divisions of the outline are associated with the eightdirections shown in FIG. 4. It is then judged on which of the divisionsthe point of intersection T lies. An inserting direction is determinedbased on the division on which the point of intersection T lies.Referring to FIG. 23, the point of intersection T lies on a divisionassociated with the left downward direction (the direction associatedwith the point Q6 in FIG. 11).

At step S16, similarly to step S 5 performed in the first embodiment,arrow information indicating the determined inserting direction issuperposed on an image, and the resultant image is displayed on thedisplay device 21. Control is then returned to step S11, and the samesteps are performed on image data representing the next frame.

As mentioned above, according to the inserting direction detectingmethod of the second embodiment of the present invention, and theinserting direction detecting system that presents inserting directioninformation to an operator on the basis of the result of processingperformed according to the method, insertion aid information can beprovided for an operator who is unskilled in endoscopic examination.Consequently, endoscopic examination can be performed smoothly.

Moreover, since it is judged whether the shape of a halation is suitablefor detection of the direction of a lumen, incorrect inserting directionaid information will not be displayed.

The binary-coded image H of a halation may, as shown in FIG. 24A, have acomplex outline. This may cause lots of unnecessary jumps of controlafter fining is completed. In this case, known expansion is performed.Consequently, the outline is smoothed as shown in FIG. 24B. Thereafter,fining is performed (for expansion and fining, refer to, for example,“Guide to Computer Image Processing” (P. 75-83, supervised by HideyukiTamura, compiled by Industrial Technology Center of Japan, published bySouken Publishing Co. Ltd., sold by Seiun Co. Ltd.).

In the present embodiment, the center Ck of an arc is searched anddetermined. Alternatively, a Hough conversion technique or any othershape sampling technique may be adopted.

Moreover, if an image suffers from a plurality of halations as shown inFIG. 25A, a series of the processing to which the present embodiment isadapted is performed with the fined pixels serving as limits hk and hk+1of the halations linked as shown in FIG. 25B. Whether the limit hk+1lies within a circle whose center coincides with the limit hk and whoseradius is expressed as rhk (rhk is set to an appropriate value, forexample, 20) is checked based on coordinates representing the limit hkin order to judge whether linkage is feasible.

Third Embodiment

FIG. 26 to FIG. 28 are concerned with a third embodiment of the presentinvention. FIG. 26 is a flowchart describing inserting directiondetection. FIG. 27 is an explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing described inFIG. 26. FIG. 28 is an explanatory diagram concerning arc shape judgmentto be performed during the processing described in FIG. 26.

The third embodiment is nearly identical to the first embodiment.Differences alone will be described. The same reference numerals will beassigned to components identical to those of the first embodiment, andthe description of the components will be omitted.

As the third embodiment of the present invention, a description will bemade of another method of detecting an inserting direction by utilizingthe property of the shape of a halation, which has been described inrelation to the second embodiment, in case a lumen disappears from afield of view for imaging. Also described is an inserting directiondetecting system that assists in realizing smoother endoscopicexamination by presenting inserting direction information to an operatoron the basis of the result of processing performed according to themethod.

An endoscope system and an inserting direction detecting system inaccordance with the present embodiment have the same configurations asthe one described in relation to the first embodiment and the one inaccordance with the first embodiment. The contents of the main program26 are different. Therefore, the contents of image processing to beperformed as described in the main program 26 will be described below.

FIG. 26 is a flowchart describing inserting direction detectiondescribed in the main program 26. At step S21, similarly to step S1described in FIG. 8 according to the first embodiment, a red image isacquired from among red, green, and blue images constituting a receivedendoscopic image. The green or blue image or a luminance image may beused to perform the same processing as the one described below.

At step S22, similarly to step S12 performed according to the secondembodiment, halation pixels are sampled in order to produce abinary-coded image H.

At step S23, similarly to step S13 performed according to the secondembodiment, fining described in conjunction with FIG. 19 and FIG. 20 isperformed on the halation image H. Pixels whose locations arerepresented by coordinates h(x, y) are generated and sampled. At thistime, Ns pixels whose locations are represented by coordinates h(x, y)are sampled so that the pixels will include pixels serving at bothlimits of the halation and will be arranged equidistantly. Hereinafter,the Ns sampling-pixels whose locations are represented by coordinatesh(x, y) shall be described as pixels hj(xj, yj) where 1≦j≦Ns issatisfied.

According to the present embodiment, a line L(k) perpendicular to themidpoint of a segment linking each of pixel pairs selected from amongthe sampling-pixels hj(xj, yj), that is, pairs of pixels h1(x1, y1) andh2(x2, y2), pixels h2(x2, y2) and h3(x3, y3), . . . , pixelshNs−2(xNs−2, yNs−2) and hNs−1(xNs−1, yNs−1), and pixels hNs−1(xNs−1,yNs−1) and hNs(xNs, yNs) is defined. Herein, 1≦k≦Ns−1 is satisfied.

FIG. 27 shows an example of segments L(k) and presents an example ofcalculation of a candidate for the direction of a lumen. If the pixelshj(xj, yj) lie on an arc, the defined segments L(k) intersects oneanother at the center C of the arc. A candidate for the direction of alumen can be determined by associating the position of the center C withany of the eight directions shown in FIG. 4. When the segments L(k) donot intersect one another at one point, a barycenter CR of pixelscontained in a closed domain R defined with a plurality of points ofintersection as shown in FIG. 28 is calculated and substituted for thecenter C. The coordinates (Xc, Yc) representing the barycenter CR areexpressed as follows:

$\begin{matrix}{{X_{c} = {\frac{1}{N_{r}} \times \left( {\sum\limits_{i = 1}^{N_{r}}x_{ri}} \right)}},{Y_{c} = {\frac{1}{N_{r}} \times \left( {\sum\limits_{i = 1}^{N_{r}}y_{ri}} \right)}}} & \left( 14^{\prime} \right)\end{matrix}$where Nr denotes the number of pixels contained in the domain R, and Xriand Yri denote coordinates representing the position of the i-th pixelin the horizontal and vertical directions.

At step S24, it is judged whether the calculated candidate for thedirection of a lumen is reliable, that is, whether a halation is seen asan arc. Specifically, the area (number of pixels) Ra of the closeddomain R shown in FIG. 28 is compared with a threshold THR. If Ra≦THR issatisfied, the halation is seen as an arc and the calculated candidatefor the direction of a lumen is reliable. If Ra>THR is satisfied, thehalation is not seen as an arc and the calculated candidate isunreliable.

If it is judged from the result of judgment at step S24 that thecandidate for the direction of a lumen is reliable, control is passedfrom step S25 to step S26. Otherwise, control is returned to step S21.It is judged whether control is passed to a step of processing imagedata that represents the next frame.

At step S26, similarly to step S5 performed according to the firstembodiment, arrow information indicating the calculated insertingdirection is superposed on an image. The resultant image is thendisplayed on the display device 21. Control is then returned to stepS21, and the same steps are repeated for the next frame.

As described above, according to the inserting direction detectingmethod of the third embodiment of the present invention and theinserting direction detecting system that presents inserting directioninformation to an operator on the basis of the result of processingperformed according to the method, insertion aid information can beprovided for an operator who is unskilled in endoscopic examination.Consequently, endoscopic examination can be performed smoothly.Moreover, since it is judged whether the shape of a halation is helpfulin detecting the direction of a lumen, incorrect inserting direction aidinformation will never be displayed.

As mentioned above, a candidate for the direction of a lumen is inferredfrom the coordinates representing the point of intersection of thesegments L(k). As shown in FIG. 15, points of intersection at which thesegments L(k) intersects a division of the outline of an image may bedetected. A direction associated with a division of the outline whichthe largest number of segments L(k) intersect may be determined as acandidate for the direction of a lumen.

Fourth Embodiment

FIG. 29 to FIG. 33 are concerned with a fourth embodiment of the presentinvention. FIG. 29 is a flowchart describing inserting directiondetection. FIG. 30 is a first explanatory diagram concerning a method ofdetermining the direction of a lumen during the processing described inFIG. 29. FIG. 31 is a second explanatory diagram concerning the methodof determining the direction of a lumen during the processing describedin FIG. 29. FIG. 32 is a third explanatory diagram concerning the methodof determining the direction of a lumen during the processing describedin FIG. 29. FIG. 33 is a fourth explanatory diagram concerning themethod of determining the direction of a lumen during the processingdescribed in FIG. 29.

The fourth embodiment is nearly identical to the first embodiment.Differences alone will be described. The same reference numerals will beassigned to components identical to those of the first embodiment, andthe description of the components will be omitted.

Described as the fourth embodiment of the present invention is aninserting direction detecting method according to which if a lumendisappears from a field of view for imaging, the direction of the lumenis determined based on a time-sequential shift of a view seen within afield of view from a view containing the lumen. Also described is aninserting direction detecting system capable of assisting in performingendoscopic examination smoothly by presenting inserting directioninformation to an operator on the basis of the result of processingperformed according to the method.

FIG. 29 is a flowchart describing inserting direction detection that isexecuted according to the main program 26 employed in the presentembodiment. At step S31, similarly to step S1 described in FIG. 8 inrelation to the first embodiment, a red image is acquired from among thered, green, and blue images constituting a received endoscopic image.Alternatively, the green or blue image or a luminance image may be usedto perform processing identical to the one described below. At step S32,in order to detect a lumen within a field of view, binary-coded pixelsrepresenting a shade are sampled using a threshold THD. Specifically, abinary-coded image D is produced based on values r(x, y) of pixels whoselocations are represented by coordinates (x, y) (0≦x<I SX, 0≦y<I SY).The values of the pixels d(x, y) constituting the binary-coded image Dmeet the following condition:d(x,y)=1 if r(x,y)≦THDd(x,y)=0 if r(x,y)>THD  (15)where the threshold THD is set to, for example, 20.

At step S33, the number of pixels having a value of 1 and beingcontained in the binary-coded image D, that is, the number of pixelsrepresenting the shade, Nd, is calculated.

At step S34, the number of pixels Nd calculated at step S33 is comparedwith the threshold THL in order to determine whether the number ofpixels representing the shade is large enough to judge that a lumen isfound in a field of view. The threshold THL is, according to the presentembodiment, set to 10% of the number of all pixels. Namely,THL=(ISX×ISY)/10  (16)

If Nd≧THL is satisfied, control is passed to step S35. Otherwise,control is passed to step S37.

At step S35, a barycenter R among the Nd sampling-pixels representingthe shade that may a lumen found in a field of view is calculated. FIG.30 shows an example of the barycenter R. Pixels representing a shade aresampled from data of a raw image (red image) shown in FIG. 30A using athreshold. A domain that is a hatched part of FIG. 30B and that mayrepresent a lumen is defined, and the barycenter R of the domain iscalculated.

At step S36, a shift vector representing a shift of the barycenter R isinferred from a change in the position of the barycenter R from theposition thereof calculated from image data of the previous frame. Adescription will be made in conjunction with FIG. 31. Referring to FIG.31, F1, F2, and F3 denote frames to be received time-sequentially. Abarycenter of a domain representing a shade of a lumen visualized in theframe F1 shall be R1 and coordinates representing the position of thebarycenter R1 shall be (xr1, yr1). Likewise, a barycenter of a domainrepresenting the shade visualized in the frame F2 shall be R2 andcoordinates representing the position of the barycenter R2 shall be(xr2, yr2). A shift vector v1 tracing a shift of the lumen within afield of view is calculated as follows:v1=(xr2−xr1,yr2−yr1)  (17)

Likewise, a shift vector v2 relevant to a change from the frame F2 tothe frame F3 is calculated. Barycenters Ri and shift vectors vi (where idenotes an integer equal to or larger than 1) are stored. Thus, a changein the position of a barycenter of data representing a lumen can betraced as shown in FIG. 32.

If a lumen is unseen within a field of view for imaging, control ispassed from step S34 to step S37. The direction of a lumen is inferred.

Assuming that a lumen is visualized in a frame Fi but has disappearedfrom a field of view for producing a frame Fi+1, there is a highpossibility that the lumen may be found in the direction of animmediately preceding shift vector vi. Therefore, a direction closest tothe direction of the shift vector vi is adopted as an insertingdirection. Consequently, the lumen is caught in the field of view. Forexample, when a frame F5 shown in FIG. 33 is produced from a field ofview, the right downward direction associated with the point Q8 shown inFIG. 11 is adopted as an inserting direction. In order to determine adirection closest to the direction of a barycenter Ri, an angle isevaluated using an expression similar to the expression (7) described inrelation to the first embodiment.

At step S38, similarly to step S5 performed according to the firstembodiment, arrow information indicating an inserting direction issuperposed on an image, and the resultant image is displayed on thedisplay device 21. Control is then returned to step S21, and the samesteps are repeated for image data representing the next frame.

As mentioned above, according to the inserting direction detectingmethod of the fourth embodiment of the present invention and theinserting direction detecting system that presents inserting directioninformation to an operator on the basis of processing performedaccording to the method, if a lumen disappears from a field of view forimaging, the direction of the lumen is detected based on atime-sequential shift of a view seen within the field of view. Insertingdirection information can be presented to an operator. Consequently,insertion aid information can be provided for an operator who isunskilled in endoscopic examination. Thus, endoscopic examination can beachieved smoothly.

The number of sampling-pixels Nd is counted at step S33. At this time,labeling as well as contraction and expansion may be performed aspre-processing in order to remove pixels sampled as, for example, thoserepresenting a shade on the margin of an image caused by irregularillumination other than a shade of a lumen. Thus, a minor domain ofsampling-pixels may be removed.

Incidentally, the labeling is disclosed in, for example, “Guide toComputer Image Processing” (P. 75-83, supervised by Hideyuki Tamura,compiled by Japan Industrial Technology Center, published from SoukenPublishing Co., Ltd., sold by Seiun Co., Ltd.).

Fifth Embodiment

FIG. 34 to FIG. 36 are concerned with a fifth embodiment of the presentinvention. FIG. 34 is a flowchart describing inserting directiondetection. FIG. 35 is an explanatory diagram concerning a case wheredirection-of-lumen detection based on a shift vector is judged to beundesirable during the processing described in FIG. 34. FIG. 36 is anexplanatory diagram concerning display of a result which is performedwhen it is undesirable or unfeasible to perform inserting directiondetection during the processing described in FIG. 34.

The fifth embodiment is nearly identical to the first embodiment.Differences alone will be described. The same reference numerals will beassigned to components identical to those of the first embodiment, andthe description of the components will be omitted. Described as thefifth embodiment of the present invention are an inserting directiondetecting method and an inserting direction detecting system capable ofimproving precision by selecting an inserting direction detecting methodoptimal to an endoscopic image to be processed.

In the first to fourth embodiments of the present invention, adescription has been made of various direction-of-lumen detectingmethods based on a gradient in brightness within a field of view forimaging, the property of the shape of a halation, or a shift of a viewseen within a field of view. On the other hand, a scene visualized in anendoscopic image varies diversely. In order to effectively utilize thedetecting methods, an optimal detecting method must be selectedaccording to a scene.

Referring to the drawings, the inserting direction detecting method andinserting direction detecting system in accordance with the presentembodiment will be described below.

FIG. 34 is a flowchart describing actions to be performed by theinserting direction detecting system 12 in accordance with the presentembodiment.

At step S41, similarly to step S1 described in FIG. 8 in relation to thefirst embodiment, a red image is acquired from among red, green, andblue images constituting a received endoscopic image. The green or blueimage or a luminance image may be used to perform the same processing asthe one described below.

At step S42, it is judged whether a lumen visualized in the receivedendoscopic image can be found within a field of view or the direction ofa lumen can be detected in the received endoscopic image. As far as thelarge intestine is examined using the endoscope, if the endoscope isapproached too closely to the mucosa, the endoscope becomes out offocus. Besides, there is a scene that is visualized in red alone (calleda “red ball” among endoscopists).

It is undesirable to display an inserting direction in the image of thescene (the inserting direction can be detected according to the methodof the fourth embodiment that traces a shift vector, but priority mustbe given to reliable insertion). The endoscope 1 must be withdrawn(pulled back) once so that a lumen can be caught in a field of view.

The red-ball state is very rare and can be identified by checking withinwhat range an average of pixel values constituting the data of theentirely red image falls or a standard deviation of each of the pixelvalues falls. Otherwise, green image data may also be employed, and anaverage of pixel values constituting each of red and green image dataand a standard deviation of each of the pixel values may be checked.

If it is judged at step S42 that a lumen within a field of view or thedirection of the lumen cannot be detected, control is passed to stepS53. Otherwise, control is passed to step S43.

At step S43, it is detected whether a lumen is seen within the field ofview. Herein, the lumen is detected through a series of steps that areperformed for sampling pixels representing a shade and that aredescribed steps S32 and S33 in FIG. 29 in relation to the fourthembodiment.

At step S44, similarly to step S34 described in FIG. 29, the result ofdetection is judged. If it is judged that a lumen is seen within thefield of view, control is passed to step S45. At steps similar to stepsS35 and S36 included in the fourth embodiment, a shift vector iscalculated. Control is then returned to step S41.

On the other hand, if it is judged that a lumen is not seen within thefield of view, control is passed to step S46. At step S46, the directionof a lumen is detected based on a gradient in brightness described as aseries of steps S2, S3, and S4 in FIG. 8 in relation to the firstembodiment. Control is then passed to step S47.

At step S47, it is judged whether detection of the direction of a lumenbased on a gradient in brightness which is performed at step S46 hassucceeded. Herein, a ratio of the smallest error evaluation value min(ε(k)), which is calculated according to the expression (8), to thesecond smallest error evaluation value smin(ε(k)) (second candidate forthe direction of a lumen), that is, min(ε(k))/smin(ε(k)), is comparedwith a threshold THL. The smaller the ratio min(ε(k))/smin(ε(k)), thehigher the reliability of the result of detection. The threshold THLsatisfies 0≦THL≦1. Herein, the threshold THL shall equal 0.5. Ifmin((ε(k))/smin(ε(k))≦THL is satisfied, the detection is judged to havesucceeded. Control is then passed to step S52. Otherwise, control ispassed to step S48.

At step S48, direction-of-lumen detection is performed based on theproperty of the shape of a halation as described in relation to thesecond or third embodiment. Specifically, a series of steps described assteps S12 to S15 in FIG. 18 or steps S22 to S25 in FIG. 26 is performed,and control is passed to step S49.

At step S49, control is passed depending on whether detection based onthe property of the shape of a halation has succeeded. The judgment isidentical to the one of step S14 or S25 made depending on whether ahalation is seen as an arc. If it is judged that detection hassucceeded, control is passed to step S52. Otherwise, control is passedto step S50.

At step S50, direction-of-lumen detection based on a shift vector isperformed as described in relation to the fourth embodiment.Specifically, processing similar to step S37 in FIG. 29 is performed inorder to detect the direction of a shift of a lumen within a field ofview using data of previous frames. Control is then passed to step S51.

At step S51, it is judged whether detection of the direction of a lumenof step S50 has succeeded. A shift vector may be incorrectly detectedbecause of, for example, a change in the shape of an image of the largeintestine caused by a change in a patient's posture or an adverse effectof pulsation, an increase in the size of a shade caused by a change inan amount of light stemming from light control, or a change in a viewseen within a field of view occurring at a higher rate than a frame rate(normally 1/30 sec) and stemming from abrupt angling or the like. Inthis case, for example, as shown in FIG. 35, although a shift vector viis detected in the center of a field of view, a lumen is found outsidethe field of view in a direction that is not inferred from the shiftvector. Therefore, as shown in FIG. 35, an undetected domain is definedin the vicinity of the center of image data. When the shift vector vi isdetected within the domain, it is determined that the detection is notperformed.

If it is judged at step S51 that direction-of-lumen detection based on ashift vector has succeeded, control is passed to step S52. Otherwise,control is passed to step S53.

At step S52, similarly to step S5 performed in the first embodiment,arrow information indicating an inserting direction is superposed on animage on the basis of the result of detection. Herein, the detection isdetection of the direction of a lumen performed based on a gradient inbrightness, the property of the shape of a halation, or a shift vector.The resultant image is then displayed on the display device 21. Controlis then returned to step S41, and the processing is repeated.

At step S53, since the direction of a lumen cannot be detected in animage to be processed, initialization (discard of shift vectorinformation acquired so far) is performed in order to suspend tracing ofa shift vector. Control is then passed to step S53.

At step S54, a message “Pull back.” shown in FIG. 36 or the like isdisplayed on the display device 21 in order to prompt a doctor totemporarily withdraw the endoscope 1 so as to catch a lumen in a fieldof view or to perform a inserting procedure safely and reliably. Controlis then returned to step S41, and a series of the processing isrepeated.

As mentioned above, according to the inserting direction detectingmethod of the fifth embodiment of the present invention and theinserting direction detecting system in which the method is implemented,an optimal inserting direction detecting method is selected and employeddepending on an endoscopic image to be processed. This results insmoother endoscopic examination.

The embodiments of the present invention have been described so far. Thepresent invention is not limited to the embodiments. Needless to say,various modifications can be made within the spirit of the presentinvention.

INDUSTRIAL APPLICABILITY

As described above, according to the present invention, there isprovided an endoscope inserting direction detecting method according towhich even if a lumen disappears from a field of view, an insertingdirection can be detected.

Moreover, there is provided an endoscope inserting direction detectingsystem that assists in performing endoscopic examination more smoothlyby presenting inserting direction information to an operator accordingto the result of inserting direction detection.

Moreover, it is possible to provide an endoscope inserting directiondetecting method capable of prompting an operator to performmanipulations appropriately in case it is hard to detect an insertingdirection, such as in case an endoscope has approached too closely themucosal surface of the large intestine.

1. An endoscope inserting direction detecting method comprising: a first step of receiving an endoscopic image; a second step of sampling pixels, which represent high densities, from data of the endoscopic image; a third step of defining an approximate expression for providing an approximate state of a distribution of sampling-pixels; a fourth step of evaluating a difference between a state of distribution of the sampling-pixels and a result of an approximation based on the approximate expression; and a fifth step of determining an endoscope inserting direction, in which an endoscope should be inserted, on the basis of a result of an evaluation of the fourth step.
 2. An endoscope inserting direction detecting method according to claim 1, wherein at the third step, the distribution of sampling-pixels is approximated to a curve.
 3. An endoscope inserting direction detecting method according to claim 2, wherein the sampling is performed using a threshold.
 4. An endoscope inserting direction detecting method according to claim 1, wherein: at the third step, the distribution of sampling-pixels is approximated to an arc defined with such parameters as coordinates of a center and a radius; an arc that has the smallest error relative to the distribution of sampling-pixels is determined during the approximation; and the direction of the center of the defined arc is adopted as an endoscope inserting direction.
 5. An endoscope inserting direction detecting method according to claim 4, further comprising a sixth step of determining a plurality of inserting-direction candidates, that is, candidates for an endoscope inserting direction, wherein an inserting-direction candidate closest to the direction of the center of the arc is adopted as an endoscope inserting direction.
 6. An endoscope inserting direction detecting method according to claim 5, wherein the sampling is performed using a threshold.
 7. An endoscope inserting direction detecting method according to claim 4, wherein the sampling is performed using a threshold.
 8. An endoscope inserting direction detecting method according to claim 1, wherein the sampling is performed using a threshold.
 9. An endoscope inserting direction detecting method comprising: a first step of receiving an endoscopic image; a second step of sampling pixels, which represent high densities, from the data of the endoscopic image; a third step of determining a direction on the basis of a combination of the sampling-pixels; a fourth step of setting plural inserting-direction candidates, that is, candidates for an endoscope inserting direction; and a fifth step of determining the inserting-direction candidate closest to the determined direction as an endoscope inserting direction, in which an endoscope should be inserted.
 10. An endoscope inserting direction detecting method according to claim 9, wherein at the third step, two of the sampling-pixels are paired, and the direction of the center of a circle passing the two paired pixels is determined.
 11. An endoscope inserting direction detecting method according to claim 10, further comprising a sixth step of determining a plurality of directions by changing paired sampling-pixels and evaluating the gathering state of the directions, wherein: an endoscope inserting direction is determined based on a result of an evaluation.
 12. An endoscope inserting direction detecting method according to claim 11, wherein the sampling is performed using a threshold.
 13. An endoscope inserting direction detecting method according to claim 10, wherein the sampling is performed using a threshold.
 14. An endoscope inserting direction detecting method according to claim 9, further comprising a sixth step of determining a plurality of directions by changing paired sampling-pixels and evaluating the gathering state of the directions, wherein: an endoscope inserting direction is determined based on a result of an evaluation.
 15. An endoscope inserting direction detecting method according to claim 14, wherein the sampling is performed using a threshold.
 16. An endoscope inserting direction detecting method according to claim 9, wherein the sampling is performed using a threshold.
 17. An endoscope inserting direction detecting method comprising: a first step of receiving an endoscopic image; a second step of sampling pixels, which represent high values, from the data of the endoscopic image; a third step of defining an approximate expression for providing an approximate state of a distribution of sampling-pixels; a fourth step of evaluating an error between the distribution of sampling-pixels and a result of an approximation based on the approximate expression; a fifth step of determining an endoscope inserting direction, in which an endoscope should be inserted, on the basis of the distribution of sampling-pixels; and a sixth step of producing information concerning the determined inserting direction, wherein: if the result of the approximation proves unsatisfactory during the evaluation of an error from the result of the approximation, at least one of determination of an inserting direction and production of information is not performed.
 18. An endoscope inserting direction detecting method according to claim 17, wherein the approximate expression provides an approximate shape of an arc, and the evaluation is evaluation of an error between the distribution of sampling-pixels and the result of the approximation based on the approximate expression.
 19. An endoscope inserting direction detecting method according to claim 18, wherein an error between the distribution of sampling-pixels and the result of the approximation based on the approximate expression is evaluated using a threshold.
 20. An endoscope inserting direction detecting method according to claim 18, wherein the approximate expression is an equation of a circle. 